"""道长"""
"""
module是对当前.py文件生效
session是对多个.py文件生效
session之作用于一个.py文件时，作用相当于module

只对开始引用的测试方法以下的类和方法生效

module 同session
"""
import pytest

@pytest.fixture(scope='module')
def login():
    print("scope为module")

def test_01():
    print("用例01")

#传入logoutfixture
def test_02(login):
    print("用例02")


class TestLogin():

    def test_1(self):
        print("用例1")

    #传入logoutfixture
    def test_2(self):
        print("用例2")

    def test_3(self):
        print("用例3")


if __name__ == '__main__':
    pytest.main()
"""
test11.py::TestLogin::test_01 PASSED                                     [ 25%]用例1

test11.py::TestLogin::test_02 scope为class
PASSED                                     [ 50%]用例2

test11.py::TestLogin::test_03 PASSED                                     [ 75%]用例3

test11.py::TestLogin::test_04 PASSED                                     [100%]用例4
"""